package DoExercise.JianzhiOffer;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;
import java.util.Stack;

public class A000_TestDay
{


    public static void main(String[] args)
    {

    }


    public static int nearestLeft(int[] array, int keys)
    {
        if (array == null || array.length == 0)
        {
            return -1;
        }

        int L = 0;
        int R = array.length - 1;
        int ans = -1;

        while (L <= R)
        {
            int mid = L + (R - L) >> 1;
            if (array[mid] < keys)
            {
                ans = mid;
                R = mid - 1;
            } else
            {
                L = mid + 1;
            }
        }
        return ans;
    }

}